home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / jmod311.zip / JMODEM_C.DOC < prev    next >
Text File  |  1992-02-02  |  48KB  |  1,241 lines

  1.  
  2.                                   J M O D E M
  3.                          *  The Microsoft C Version  *
  4.                                November 28, 1991
  5.                                Richard B. Johnson
  6.                               405 Broughton Drive
  7.                           Beverly Massachusetts 01915
  8.                                BBS (508) 922-3166
  9.  
  10.           Introduction.
  11.  
  12.           JMODEM was first introduced about two years ago. It has en-
  13.           joyed a steady increase in popularity around the world. It
  14.           has even been explained in some detail in John Dvorak's book
  15.           on PC communications; Dvorak's Guide to PC Telecommunica-
  16.           tions, 1990, Osborne-McGraw-Hill, 2600 Tenth Street,
  17.           Berkeley, CA.
  18.  
  19.           JMODEM was first written in assembly language. Since this
  20.           language is hard to read and use, it has been difficult for
  21.           communications program developers to incorporate it into
  22.           their programs directly. Instead it must be executed as an
  23.           external protocol. Now JMODEM has been written in the C
  24.           Language. C has become the de-facto standard for portable
  25.           code development even though there isn't presently any code
  26.           that is truly portable across many different machines. The
  27.           writing of JMODEM in C will make it easier for software de-
  28.           velopers throughout the world to use this very useful pro-
  29.           tocol.
  30.  
  31.           You can use this new version of JMODEM just as the older
  32.           versions written in assembly. It has a new color sign-on
  33.           screen and status-block windows that overlap. Although the
  34.           new JMODEM.EXE code is larger than the assembly-language
  35.           version, JMODEM.COM, the program still executes very fast
  36.           because much effort has been taken to streamline the C code.
  37.           JMODEM.COM required 64 k of RAM (one segment) to execute
  38.           properly. JMODEM.EXE requires 79 k to allow the screens to
  39.           be written properly, and 66 k of free RAM to execute without
  40.           aborting although the previous screen content will be lost.
  41.           Like all versions of JMODEM, this version is 100% compatible
  42.           with all previous version including Beta version 1.00. From
  43.           it's inception, the essential structure of JMODEM has never
  44.           been changed.
  45.  
  46.           How to install JMODEM.
  47.  
  48.           JMODEM executes best from a batch file as an external pro-
  49.           tocol for any of the communications programs that have ex-
  50.           ternal-protocol capability. A typical communications program
  51.           is TELIX.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                                      - 1 -
  60.                                                JMODEM, the C Version
  61.  
  62.  
  63.  
  64.           Here is a batch file used with TELIX for uploads:
  65.  
  66.           @ECHO OFF
  67.           Rem * JMODEM TELIX Upload batch file.
  68.           C:\TELIX\JMODEM S1 %3
  69.           Rem           | ||  |_________ file name (passed by TELIX)
  70.           Rem           | ||____________ COM port (1 - 4)
  71.           Rem           | |_____________ Send
  72.           Rem           |_______________ Path and name of JMODEM
  73.  
  74.  
  75.           This is a batch file used with TELIX for downloads:
  76.  
  77.           @ECHO OFF
  78.           Rem * JMODEM TELIX Download batch file.
  79.           C:\TELIX\JMODEM R1 %3
  80.           Rem           | ||  |_________ file name (passed by TELIX)
  81.           Rem           | ||____________ COM port (1 - 4)
  82.           Rem           | |_____________ Receive
  83.           Rem           |_______________ Path and name of JMODEM
  84.  
  85.  
  86.           This is a batch file used for PCPLUS (PROCOMM) uploads:
  87.  
  88.           @ECHO OFF
  89.           Rem * JMODEM PCPLUS Upload batch file.
  90.           C:\TELIX\JMODEM S1 %1
  91.           Rem           | ||  |_________ file name (passed by PCPLUS)
  92.           Rem           | ||____________ COM port (1 - 4)
  93.           Rem           | |_____________ Send
  94.           Rem           |_______________ Path and name of JMODEM
  95.  
  96.  
  97.           This is a batch file for PCPLUS (PROCOMM) ownloads:
  98.  
  99.           @ECHO OFF
  100.           Rem * JMODEM PCPLUS Download batch file.
  101.           C:\TELIX\JMODEM R1 %1
  102.           Rem           | ||  |_________ file name (passed by PCPLUS)
  103.           Rem           | ||____________ COM port (1 - 4)
  104.           Rem           | |_____________ Receive
  105.           Rem           |_______________ Path and name of JMODEM
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.                                      - 2 -
  119.                                                JMODEM, the C Version
  120.  
  121.  
  122.           If I wished to receive in the "batch" mode, I could make a
  123.           file like this. Notice that some communications programs do
  124.           not allow multiple file names. Note that the comments "!"
  125.           are NOT ALLOWED in a DOS batch file.
  126.  
  127.                         :DO_LOOP                   ! Return here
  128.                         IF "%3" == "" GOTO DONE    ! More parameters?
  129.                         C:\TELIX\JMODEM R1 %3      ! Execute JMODEM
  130.                         IF ERRORLEVEL 1 GOTO DONE  ! Abort on error
  131.                         SHIFT                      ! %4 becomes %3
  132.                         GOTO DO_LOOP               ! Continue
  133.                         :DONE                      ! Exit batch file
  134.  
  135.           If you do not know what "%" parameters are used to pass the
  136.           file name, all you have to do is make a "dummy" batch file
  137.           that contains the following:
  138.  
  139.                         @ECHO OFF
  140.                         ECHO %1
  141.                         ECHO %2
  142.                         ECHO %3
  143.                         ECHO %4
  144.                         ECHO %5
  145.                         PAUSE
  146.  
  147.           When this is executed, you will see something like this:
  148.  
  149.                 1200
  150.                 1
  151.                 FILENAME.TYP
  152.                 ECHO is off
  153.                 ECHO is off
  154.                 Strike a key when ready . . .
  155.  
  156.           The first line contains "1200" which is the baud rate. This
  157.           means that the %1 parameter contains the baud rate.
  158.  
  159.           The second line contains "1" which is the communications
  160.           adapter port being used. This means that the port is being
  161.           passed as the %2 parameter.
  162.  
  163.           The third line contains "FILENAME.TYP" which is the file
  164.           name. This means that the file name is being passed as the
  165.           %3 parameter.
  166.  
  167.           The fourth and fifth lines contain nothing to echo so DOS
  168.           replies the current state of the echo function which is
  169.           "off".
  170.  
  171.           PCPLUS handles the file name passing a little bit different.
  172.           If I execute the same "dummy" batch file from the PCPLUS
  173.           directory, the response is:
  174.  
  175.  
  176.  
  177.                                      - 3 -
  178.                                                JMODEM, the C Version
  179.  
  180.  
  181.  
  182.                 FILENAME.TYP
  183.                 ECHO is off
  184.                 ECHO is off
  185.                 ECHO is off
  186.                 ECHO is off
  187.                 Strike a key when ready . . .
  188.  
  189.           This shows us that PCPLUS passes the file name as the first
  190.           parameter and there are no other parameters. However, If I
  191.           put more parameters on the command line within PCPLUS, they
  192.           will get sent to the batch file. The response is:
  193.  
  194.                 FILENAME.001
  195.                 FILENAME.002
  196.                 FILENAME.003
  197.                 FILENAME.
  198.                 ECHO is off
  199.                 Strike a key when ready . . .
  200.  
  201.           Therefore PCPLUS allows up to four file names to be passed
  202.           providing there's room on the command line.
  203.  
  204.           Notice that these two communications programs check the
  205.           default directory for the external protocol batch file
  206.           FIRST! Therefore you must make certain that there are no
  207.           other similarly-named batch files in the current directory
  208.           or within the current path. Failure to do so will cause the
  209.           improper execution of the wrong batch file. Lets say that
  210.           th